/**
 * Created by archerzkd on 12/24/15.
 */

"use strict";

var animationRender = {};

//最简单动画，适用前几个场景
function commonAnimation(slideName) {
    var slideDom = $("[data-hash=" + slideName + "]");
    slideDom.attr("slide-animation", true);
}

//动画，适用后几个场景
function endingCommonAnimation(slideName) {
    var slideDom = $("[data-hash=" + slideName + "]");
    slideDom.attr(slideName + '-animation', true);
}

function removeEndingCommonAnimation(slideName) {
    var slideDom = $("[data-hash=" + slideName + "]");
    slideDom.removeAttr(slideName + '-animation');
}

function removeAnimation(slideName) {
    var slideDom = $("[data-hash=" + slideName + "]");
    slideDom.removeAttr("slide-animation");
}
//加载每个页面的动画
function remove(slideName) {
    switch (slideName) {
        case "cover":
            removeEndingCommonAnimation(slideName);
            break;
        default  :
            removeAnimation(slideName);
            break;
    }
}
function add(slideName) {
    switch (slideName) {
        case "cover":
            endingCommonAnimation(slideName);
            break;
        default  :
            commonAnimation(slideName);
            break;
    }
}

animationRender.add = add;
animationRender.remove = remove;

